# CMake configuration file for melon
#
# This provides the Melon::melon target, which you can depend on by adding it
# to your target_link_libraries().
#
# It also defines the following variables, although using these directly is not
# necessary if you use the Melon::melon target instead.
#  MELON_INCLUDE_DIR
#  MELON_LIBRARIES

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

set_and_check(MELON_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(MELON_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(MELON_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@")

# find_dependency() ends up changing PACKAGE_PREFIX_DIR, so save
# melon's prefix directory in the MELON_PREFIX_DIR variable
set(MELON_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")

# Include the melon-targets.cmake file, which is generated from our CMake rules
if (NOT TARGET Melon::melon)
  include("${MELON_CMAKE_DIR}/melon-targets.cmake")
endif()

# Set MELON_LIBRARIES from our Melon::melon target
set(MELON_LIBRARIES Melon::melon)

# Find melon's dependencies
find_dependency(fmt CONFIG)
find_dependency(double-conversion CONFIG)
find_dependency(Libevent CONFIG)
if (NOT @CMAKE_DISABLE_FIND_PACKAGE_Zstd@)
    find_dependency(zstd CONFIG)
endif()
if (@CMAKE_REQUIRE_FIND_PACKAGE_ZLIB@)
    find_dependency(ZLIB MODULE)
endif()
find_dependency(OpenSSL MODULE)
if (NOT @CMAKE_DISABLE_FIND_PACKAGE_unofficial-sodium@)
    find_dependency(unofficial-sodium CONFIG)
endif()
if (NOT @CMAKE_DISABLE_FIND_PACKAGE_Snappy@)
	find_dependency(Snappy CONFIG)
endif()
if (NOT @CMAKE_DISABLE_FIND_PACKAGE_LZ4@)
    find_dependency(lz4 CONFIG)
endif()

set(Boost_USE_STATIC_LIBS "@MELON_BOOST_LINK_STATIC@")
find_dependency(Boost
  COMPONENTS
    context
    filesystem
    program_options
    regex
    system
    thread
  REQUIRED
)

if (NOT melon_FIND_QUIETLY)
  message(STATUS "Found melon: ${MELON_PREFIX_DIR}")
endif()
